<template>
  <div class="unk-form">
    <el-form :model="form" label-width="80px" rules:data.rules>
      <el-form-item v-for="(item,index) in data.formOption" :key="index" :label="item.label">
        <el-input v-if="item.type=='text'" v-model="form[item.key]" :placeholder="`请输入${item.label}`" size="small"
          style="width: 240px">
        </el-input>
        <el-select v-if="item.type=='select'" v-model="form[item.key]" :placeholder="`请选择${item.label}`" size="small"
          style="width: 235px">
          <el-option v-for="i in item.selectOptionValue" :key="i.index" :value="i.deptName"></el-option>
        </el-select>
        <div v-if="item.type=='verifyIdCard'">
          <!-- <el-alert title="个人信息上传身份证正面照后自动显示 (手机号，头像，身份证反面照除外)" type="success" style="margin-bottom: 20px">
          </el-alert>
          <div class="idcardbox">
            <el-row type="flex" class="row-bg">
              <el-col :span="12">
                <el-form-item prop="imageUrl5">
                  <el-upload class="avatar-uploader idcards" :action="addheadimgurl" accept="image/png, image/jpeg"
                    :show-file-list="false" :data="addfileData" multiple:false :headers="fileUploadheaders"
                    :on-success="addhandleAvatarSuccess" :before-upload="addbeforeAvatarUpload" :disabled="isdisable">
                    <img v-if="addstuform.imageUrl5" :src="addstuform.imageUrl5" class="avatar identityposter"
                      @click="uploadSign = 5" />
                    <img v-else :src="idcard" alt="" class="el-icon-plus avatar-uploader-icon identityposter"
                      @click="uploadSign = 5" />
                  </el-upload>
                  <span class="uploadidcard">上传身份证正面</span>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item prop="imageUrl6">
                  <el-upload class="avatar-uploader idcards" :action="addheadimgurl" accept="image/png, image/jpeg"
                    :show-file-list="false" :data="addfileData" multiple:false :headers="fileUploadheaders"
                    :on-success="addhandleAvatarSuccess" :before-upload="addbeforeAvatarUpload" :disabled="isdisable">
                    <img v-if="addstuform.imageUrl6" :src="addstuform.imageUrl6" class="avatar identityposter"
                      @click="uploadSign = 6" />
                    <img v-else :src="idcards" alt="" class="el-icon-plus avatar-uploader-icon identityposter"
                      @click="uploadSign = 6" />
                  </el-upload>
                  <span class="uploadidcard">上传身份证反面</span>
                </el-form-item>
              </el-col>
            </el-row>
          </div> -->
        </div>
        <!-- <el-select v-if="item.type=='verifyIdCard'" v-model="data.tableLoadOption[item.searchKey]"
          :placeholder="`请选择${item.label}`" size="small" style="width: 235px">
          <el-option v-for="i in item.selectOptionValue" :key="i.index" :value="i.deptName"></el-option>
        </el-select> -->
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  props: {
    data: {
      default() {
        return []
      },
    }
  },
  data() {
    return {
      form: {}
    }
  },
  watch: {
    form(val, oldVal) {//普通的watch监听
      this.data.requestOption=val
    }
  },
  methods: {
    inputUpdate() {
      this.$forceUpdate
    },
    handleEditColumn(val) {
      if (val == "save") {
        this.tableOptionSaveKey = this.$refs.tree.getCheckedNodes()
        this.$store.commit("setSaveKey", this.$refs.tree.getCheckedNodes())
      } else {
        this.selectKey(this.tableOptionKey)
      }
    },
    search() {
      this.$parent.search()
    },
    selectKey(saveKey) {
      let _this = this
      _this.resetCheckedeKey = []
      saveKey.forEach((item, index) => {
        _this.resetCheckedeKey.push(item.key)
      })
    },
    studentatt() {
      this.$parent.studentatt();
    },
    perfecttheinformation() {
      this.$parent.perfecttheinformation();
    },
    deleteRow(studentId, index) {
      this.$parent.deleteRow(studentId);
      this.tableData.splice(index, 1);
    },
  },
  created() {
    // let _this = this
    // _this.data.formOption.forEach((item, index) => {
    //   _this.form[item.key] = "";
    // })
    // debugger
    console.log(this.data.requestOption, "oooooooooooooooooooooooooooo")
  }
}
</script>
<style scoped>
</style>